from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver = webdriver.Chrome() 
driver.get("https://www.baidu.com")
driver.implicitly_wait(10)
cookies = driver.get_cookies()
# print(cookies)
driver.add_cookie({'name':'cq','value':'1231 43'})
cookies = driver.get_cookies()
# print(cookies)

for cookie in cookies:
   print('%s->%s' % (cookie['name'],cookie['value']))

driver.quit()